class tracer:
    def __init__(self, meth):
        print(meth)
        print('in tracer_init')
        self.calls = 0
        self.meth = meth

    def __get__(self, instance, owner):
        def wrapper(*args, **kwargs):
            self.calls += 1
            print('call %s to %s' % (self.calls, self.meth.__name__))
            return self.meth(instance, *args, **kwargs)
        return wrapper


class Person:
    def __init__(self, name, pay):
        self.name = name
        self.pay = pay

    @tracer
    def giveRaise(self, percent):
        self.pay *= (1.0 + percent)

    @tracer
    def lastName(self):
        return self.name.split()[-1]


# print('methods...')
# bob = Person('Bob Smith', 50000)
# sue = Person('Sue Jones', 100000)
# print(bob.name, sue.name)
# sue.giveRaise(.10)
# print(int(sue.pay))
# print(bob.lastName(), sue.lastName())


@tracer
def spam(a, b, c):
    print(a + b + c)


spam(1, 23, 3)
